package com.lei.chinese_herbal_medicine.Entity;

import java.io.Serializable;

public class Layer implements Serializable {
    private String id;

    private Float learnRate=0.00001f;

    private Float freezeRate=1f;

    private Float attenuationRate=0.1f;

    private Integer epoch=0;

    private static final long serialVersionUID = 1L;

    public Layer(String id, Float learnRate, Float freezeRate, Float attenuationRate, Integer epoch) {
        this.id = id;
        this.learnRate = learnRate;
        this.freezeRate = freezeRate;
        this.attenuationRate = attenuationRate;
        this.epoch = epoch;
    }

    public Layer() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public Float getLearnRate() {
        return learnRate;
    }

    public void setLearnRate(Float learnRate) {
        this.learnRate = learnRate;
    }

    public Float getFreezeRate() {
        return freezeRate;
    }

    public void setFreezeRate(Float freezeRate) {
        this.freezeRate = freezeRate;
    }

    public Float getAttenuationRate() {
        return attenuationRate;
    }

    public void setAttenuationRate(Float attenuationRate) {
        this.attenuationRate = attenuationRate;
    }

    public Integer getEpoch() {
        return epoch;
    }

    public void setEpoch(Integer epoch) {
        this.epoch = epoch;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Layer other = (Layer) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getLearnRate() == null ? other.getLearnRate() == null : this.getLearnRate().equals(other.getLearnRate()))
            && (this.getFreezeRate() == null ? other.getFreezeRate() == null : this.getFreezeRate().equals(other.getFreezeRate()))
            && (this.getAttenuationRate() == null ? other.getAttenuationRate() == null : this.getAttenuationRate().equals(other.getAttenuationRate()))
            && (this.getEpoch() == null ? other.getEpoch() == null : this.getEpoch().equals(other.getEpoch()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getLearnRate() == null) ? 0 : getLearnRate().hashCode());
        result = prime * result + ((getFreezeRate() == null) ? 0 : getFreezeRate().hashCode());
        result = prime * result + ((getAttenuationRate() == null) ? 0 : getAttenuationRate().hashCode());
        result = prime * result + ((getEpoch() == null) ? 0 : getEpoch().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", learnRate=").append(learnRate);
        sb.append(", freezeRate=").append(freezeRate);
        sb.append(", attenuationRate=").append(attenuationRate);
        sb.append(", epoch=").append(epoch);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
